package com.quickfile;

import java.io.IOException;
import java.io.InputStream;
import java.nio.channels.FileChannel;

public abstract class FileInputStream extends InputStream {

	public static FileInputStream newInstance(File file) {
		return FileSystemContext.fileSystemFactory.newFileInputStream(file);
	}

	public static FileInputStream newInstance(String filepath) {
		return FileSystemContext.fileSystemFactory.newFileInputStream(filepath);
	}

	public abstract int available() throws IOException;

	public abstract void close() throws IOException;

	public abstract FileChannel getChannel();

	public abstract int read() throws IOException;

	public abstract int read(byte[] b) throws IOException;

	public abstract int read(byte[] b, int off, int len) throws IOException;

	public abstract long skip(long n) throws IOException;
}
